﻿@using MvcPaging
@model MvcApplication5.Models.IndexModel

@{
    ViewBag.Title = "Category";
    Layout = null;

    var highlight = (from item in Model.News
                     select item).Take(3);
}

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="/css/style.css" media="all" />
    <link href="/CSS/styleSlide.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-base.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-topbar.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-sidebar.css" rel="stylesheet" />
    <script src="/CSS/ddlevelsmenu.js"></script>
    <script src="/CSS/jquerySlide.js"></script>
</head>

<body>
<div class="main">
	<div class="header">
        <div id="wowslider-container1">
	        <div class="ws_images">
                <ul>     
                    <li><img src="../../CSS/Images/banner.jpg" id="wows1_0" /></li>
                    <li><img src="../../CSS/Images/banner2.jpg" id="wows1_1"/></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_2" /></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_3" /></li>
                </ul>
            </div>
	    </div>
    </div> <!--End header-->
    <div class="header-footer"></div>
    <div class="menu">
    	<ul>            
        	<li class="menu-sub" style="background-color:#d90000; border-right:#d90000;"><a href="/NewsSite" class="menu-sub-text">Trang chủ</a></li>
            @foreach (var item in Model.Categories.Where(c => c.Tag.Length == 4))
            {
                
                if(item.Tag != ViewBag.Tag){
                    <li class="menu-sub"><a href="/NewsSite/Category/@item.CategoryId" class="menu-sub-text">@item.Name</a></li>
                }
                else{                    
                    <li class="menu-sub" style="background-color:white;"><a href="/NewsSite/Category/@item.CategoryId" class="menu-sub-text2">@item.Name</a></li>
                }
            }                            
        </ul>
    </div> <!--End menu-->
    
    <div class="body">
    	<div class="body-left">
           <div class="body-left-topic01">
           		<div class="body-left-topic-header01" style="background-color:white;">
                       <ul class="sub-menu">
                           @foreach (var item in Model.Categories.Where(c => c.Tag.Length == 8 && c.Tag.Substring(0,4).Contains(ViewBag.Tag))){
                               if(item.Tag != ViewBag.subTag){
                                    <li class="sub-menu-item"><a href="/NewsSite/Category/@item.CategoryId" class="sub-menu-text">@item.Name.ToUpper()</a></li>
                               }else{
                                    <li class="sub-menu-item"><a href="/NewsSite/Category/@item.CategoryId" class="sub-menu-text2">@item.Name.ToUpper()</a></li>
                               }
                           }
                       </ul>
           		</div>
                <div class="category-hightlight-box">
                	<div class="body-left-topic-content01-highlight01">
                    	<div class="body-left-topic-content01-highlight-title">
                        	<a href="/NewsSite/Details/@Model.Highlights.First().NewsId" style="text-decoration:none"><h2 class="body-left-topic-content01-highlight01-text">@Model.Highlights.First().Title</h2></a>
                        </div>
                        <a href="/NewsSite/Details/@Model.Highlights.First().NewsId"><img class="body-left-topic-content01-highlight-image01" src="/css/images/@Model.Highlights.First().Image"></a>
                    </div>
                    @foreach (var item in Model.Highlights.Where(c => c.NewsId != Model.Highlights.First().NewsId))
                    {                        
					    <div class="body-left-topic-content01-highlight02">
                    	    <div class="body-left-topic-content01-highlight-title">
                        	    <a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none"><h2 class="body-left-topic-content01-highlight02-text">@item.Title</h2></a>
                            </div>
                    	        <a href="/NewsSite/Details/@item.NewsId"><img class="body-left-topic-content01-highlight-image02" src="/css/images/@item.Image">
                        </div>                        
                    }                    
                </div> <!--End category-hightlight-box-->
               <div class="news-tab">
               <ul class="news-tab-menu">
                   @if(Model.type == 0){                   
                        <li class="news-tab-submenu"><a href="/NewsSite/Category/@ViewBag.Id" class="news-tab-submenu-text">Tin mới</a></li>
                        <li class="news-tab-submenu2"><a href="/NewsSite/Category/@ViewBag.Id?type=hot" class="news-tab-submenu-text2">Bài hot</a></li>
                   }else{
                        <li class="news-tab-submenu2"><a href="/NewsSite/Category/@ViewBag.Id" class="news-tab-submenu-text2">Tin mới</a></li>
                        <li class="news-tab-submenu"><a href="/NewsSite/Category/@ViewBag.Id?type=hot" class="news-tab-submenu-text">Bài hot</a></li>
                   }
               </ul>
               </div>
               @foreach(var item in Model.News){
                   var Author = item.Author != null ? item.Author.Name : "";
                   <div class="category-newslist">
                       <div class="category-newslist-image">
                            <a href="/NewsSite/Details/@item.NewsId"><img src="/CSS/images/@item.Image" style="width:200px; height:180px"/></a>
                       </div>
                       <div class="category-newslist-content">
                           <h2><a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none">@item.Title</a></h2>
                           <p>Tác giả: @Author | @item.PublishedDate | Chuyên mục: <a href="/NewsSite/Category/@item.CategoryId" class="category-newslist-category">@item.Category.Name</a></p>
                           <p class="category-newslist-summary">@item.Summary</p>
                       </div>
                    </div>
               }
               <div class="paging-box">
                    <p class="pager">@Html.Pager(Model.News.PageSize, Model.News.PageNumber, Model.News.TotalItemCount)</p>                                   
                </div>
           </div> <!--End body-left-topic01-->                              
        </div> <!--End body-left-->
        <div class="body-right">
            <div class="body-right-header">
                @using(Html.BeginForm("Search","NewsSite")){
                    <input type="text" class="body-right-searchbar" name="searchString"/>
                    <input type="submit" class="body-right-searchbutton" value="Tìm kiếm"/>
                }
            </div>            
            @foreach(var item in Model.Advertisement){
                <div class="body-right-content">
                    <div class="advertise-item">
                        <div class="advertise-title">@item.Title</div>
                        <div class="advertise-link">@item.link</div>
                    <div class="advertise-content">
                        <img width="90" height="90" src="../../CSS/Images/@item.Image"/>
                        <div class="advertise-description">
                            @item.Description
                        </div>
                    </div>                    
                </div>                
            </div>
            }
        </div> <!--End body-right-->
    </div> <!--End body-->
    
</div> <!--End main-->
</body>
</html>
